<% provide(:title, 'Projects') %>


    <div class="section_title">
    <h1>Projects</h1>
    </div>
    <section id="projects" class="section">

      <% @projects.each do |p| 
        %> 

       <div class="span3 features project_container">
          <div class="half_top">  <div class="module_image_wrap "> <%= image_tag("projects/"+p.imgName, size: "100", :alt => "logo" ) %></div>
            </div>
       <div class="half_bottom">
        <h2><div class="project_title"> <%= p.title %> </div></h2>
       <p class="shortDesc">   <%= p.shortDesc[0...60] + (p.shortDesc.length > 60 ? "..." : "") %></p>
          <p><a class="btn btn-theme" href="#" data-toggle="modal" data-target="#p_<%= p.id%>">Read more »</a></p>
        </div>
      </div>

<!-- Modal -->
<div class="modal fade" id="p_<%= p.id%>" tabindex="-1" role="dialog" aria-labelledby="projectModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel"><%= p.title %></h4>
      </div>
      <div class="modal-body">
       <div class="row span9">
                            <div class="span5">
                                <%= image_tag("projects/"+p.imgName, size: "400", :alt => "logo" ) %>
                            </div>
                            <div class="span3">
                          <p> <%= p.longDesc%>
                                    </p>
              <%
               for tag in p.tag_names.split(",") do %>
              <span class="label label-info"><%=tag%></span>
              <%end%>
              </div>
               </div>
                        </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
  

      <% end %>
  <!-- Button trigger modal -->




  </section>